package com.wjjun.test.ui.window

import android.view.View
import androidx.databinding.ViewDataBinding
import com.wjjun.base.ui.activity.BaseActivity
import com.wjjun.base.ui.viewmodel.BaseItemViewModel
import com.wjjun.base.ui.viewmodel.BaseViewModel
import com.wjjun.base.ui.window.BaseListBottomDialog
import com.wjjun.test.ui.viewmodel.TestMenuViewModel

/**
 *
 * author : wangjunjun
 * date   : 2022/7/18
 * desc   :
 */
class TestListDialog(context: BaseActivity) : BaseListBottomDialog<TestListDialogViewModel, ViewDataBinding>(context) {

    override fun initContent() {
        super.initContent()
    }

    override suspend fun fetchData(pageNum: Int, pageSize: Int, useCache: Boolean, param: Any?) {
        val list = ArrayList<BaseItemViewModel<*>>()
        list.add(TestMenuViewModel("菜单1"))
        list.add(TestMenuViewModel("菜单2"))
        list.add(TestMenuViewModel("菜单3"))
        list.add(TestMenuViewModel("菜单4"))
        list.add(TestMenuViewModel("菜单5"))
        list.add(TestMenuViewModel("菜单6"))
        setData(list)
    }

    override fun onItemClick(view: View, itemViewModel: BaseViewModel) {
        dismiss()
    }

    override fun onClick(view: View) {

    }
}